package main

import (
	"fmt"
	"strings"
)

func main() {
	topic := "devices/aaa/connect"
	var deviceID string
	split := strings.Split(topic, "/")
	// 使用 Sscanf 提取 aaa
	if len(split) >= 2 {
		deviceID = split[1]
	}

	fmt.Println("提取出的 deviceID:", deviceID)
}
